﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Mapper&lt;TFrom, TTo&gt;
   | CodeJam </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Mapper&lt;TFrom, TTo&gt;
   | CodeJam ">
    <meta name="generator" content="docfx 2.23.1.0">
    
    <link rel="shortcut icon" href="../../favicon.ico">
    <link rel="stylesheet" href="../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../styles/docfx.css">
    <link rel="stylesheet" href="../../styles/main.css">
    <meta property="docfx:navrel" content="../../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    <meta property="docfx:rel" content="../../">
    
  </head>
  <body data-spy="scroll" data-target="#affix">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../../index.html">
                <img id="logo" class="svg" src="../../images/CodeJam.Main.Icon.png" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list"></div>
          <div class="sr-items"></div>
          <ul id="pagination"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="CodeJam.Mapping.Mapper`2">
  
  
  <h1 id="CodeJam_Mapping_Mapper_2" data-uid="CodeJam.Mapping.Mapper`2" class="text-break">Class Mapper&lt;TFrom, TTo&gt;
  </h1>
  <div class="markdown level0 summary"><p>Maps an object of <em>TFrom</em> type to an object of <em>TTo</em> type.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><span class="xref">Mapper&lt;TFrom, TTo&gt;</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CodeJam.Mapping.html">CodeJam.Mapping</a></h6>
  <h6><strong>Assembly</strong>: CodeJam.Blocks.dll</h6>
  <h5 id="CodeJam_Mapping_Mapper_2_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class Mapper&lt;TFrom, TTo&gt;</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">TFrom</span></td>
        <td><p>Type to map from.</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TTo</span></td>
        <td><p>Type to map to.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CodeJam_Mapping_Mapper_2_examples"><strong>Examples</strong></h5>
  <p>This example shows how to map one object to another.</p>
<pre><code source="Blocks\tests\Mapping\Examples\MapTests.cs" region="Example"></code></pre>

  <h3 id="methods">Methods
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2_GetMapper.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602.GetMapper%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L59">View Source</a>
  </span>
  <a id="CodeJam_Mapping_Mapper_2_GetMapper_" data-uid="CodeJam.Mapping.Mapper`2.GetMapper*"></a>
  <h4 id="CodeJam_Mapping_Mapper_2_GetMapper" data-uid="CodeJam.Mapping.Mapper`2.GetMapper">GetMapper()</h4>
  <div class="markdown level1 summary"><p>Returns a mapper to map an object of <em>TFrom</em> type to an object of <em>TTo</em> type.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Func&lt;TFrom, TTo, IDictionary&lt;object, object&gt;, TTo&gt; GetMapper()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Func</span>&lt;TFrom, TTo, <span class="xref">System.Collections.Generic.IDictionary</span>&lt;<span class="xref">System.Object</span>, <span class="xref">System.Object</span>&gt;, TTo&gt;</td>
        <td><p>Mapping expression.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2_GetMapperEx.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602.GetMapperEx%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L51">View Source</a>
  </span>
  <a id="CodeJam_Mapping_Mapper_2_GetMapperEx_" data-uid="CodeJam.Mapping.Mapper`2.GetMapperEx*"></a>
  <h4 id="CodeJam_Mapping_Mapper_2_GetMapperEx" data-uid="CodeJam.Mapping.Mapper`2.GetMapperEx">GetMapperEx()</h4>
  <div class="markdown level1 summary"><p>Returns a mapper to map an object of <em>TFrom</em> type to an object of <em>TTo</em> type.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Func&lt;TFrom, TTo&gt; GetMapperEx()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Func</span>&lt;TFrom, TTo&gt;</td>
        <td><p>Mapping expression.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2_GetMapperExpression.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602.GetMapperExpression%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L43">View Source</a>
  </span>
  <a id="CodeJam_Mapping_Mapper_2_GetMapperExpression_" data-uid="CodeJam.Mapping.Mapper`2.GetMapperExpression*"></a>
  <h4 id="CodeJam_Mapping_Mapper_2_GetMapperExpression" data-uid="CodeJam.Mapping.Mapper`2.GetMapperExpression">GetMapperExpression()</h4>
  <div class="markdown level1 summary"><p>Returns a mapper expression to map an object of <em>TFrom</em> type to an object of <em>TTo</em> type.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Expression&lt;Func&lt;TFrom, TTo, IDictionary&lt;object, object&gt;, TTo&gt;&gt; GetMapperExpression()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Linq.Expressions.Expression</span>&lt;<span class="xref">System.Func</span>&lt;TFrom, TTo, <span class="xref">System.Collections.Generic.IDictionary</span>&lt;<span class="xref">System.Object</span>, <span class="xref">System.Object</span>&gt;, TTo&gt;&gt;</td>
        <td><p>Mapping expression.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2_GetMapperExpressionEx.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602.GetMapperExpressionEx%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L35">View Source</a>
  </span>
  <a id="CodeJam_Mapping_Mapper_2_GetMapperExpressionEx_" data-uid="CodeJam.Mapping.Mapper`2.GetMapperExpressionEx*"></a>
  <h4 id="CodeJam_Mapping_Mapper_2_GetMapperExpressionEx" data-uid="CodeJam.Mapping.Mapper`2.GetMapperExpressionEx">GetMapperExpressionEx()</h4>
  <div class="markdown level1 summary"><p>Returns a mapper expression to map an object of <em>TFrom</em> type to an object of <em>TTo</em> type.
Returned expression is compatible to IQueriable.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Expression&lt;Func&lt;TFrom, TTo&gt;&gt; GetMapperExpressionEx()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Linq.Expressions.Expression</span>&lt;<span class="xref">System.Func</span>&lt;TFrom, TTo&gt;&gt;</td>
        <td><p>Mapping expression.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2_Map__0_.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602.Map(%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L68">View Source</a>
  </span>
  <a id="CodeJam_Mapping_Mapper_2_Map_" data-uid="CodeJam.Mapping.Mapper`2.Map*"></a>
  <h4 id="CodeJam_Mapping_Mapper_2_Map__0_" data-uid="CodeJam.Mapping.Mapper`2.Map(`0)">Map(TFrom)</h4>
  <div class="markdown level1 summary"><p>Returns a mapper to map an object of <em>TFrom</em> type to an object of <em>TTo</em> type.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TTo Map(TFrom source)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TFrom</span></td>
        <td><span class="parametername">source</span></td>
        <td><p>Object to map.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TTo</span></td>
        <td><p>Destination object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2_Map__0__1_.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602.Map(%600%2C%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L78">View Source</a>
  </span>
  <a id="CodeJam_Mapping_Mapper_2_Map_" data-uid="CodeJam.Mapping.Mapper`2.Map*"></a>
  <h4 id="CodeJam_Mapping_Mapper_2_Map__0__1_" data-uid="CodeJam.Mapping.Mapper`2.Map(`0,`1)">Map(TFrom, TTo)</h4>
  <div class="markdown level1 summary"><p>Returns a mapper to map an object of <em>TFrom</em> type to an object of <em>TTo</em> type.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TTo Map(TFrom source, TTo destination)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TFrom</span></td>
        <td><span class="parametername">source</span></td>
        <td><p>Object to map.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">TTo</span></td>
        <td><span class="parametername">destination</span></td>
        <td><p>Destination object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TTo</span></td>
        <td><p>Destination object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2_Map__0__1_System_Collections_Generic_IDictionary_System_Object_System_Object__.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602.Map(%600%2C%601%2CSystem.Collections.Generic.IDictionary%7BSystem.Object%2CSystem.Object%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L88">View Source</a>
  </span>
  <a id="CodeJam_Mapping_Mapper_2_Map_" data-uid="CodeJam.Mapping.Mapper`2.Map*"></a>
  <h4 id="CodeJam_Mapping_Mapper_2_Map__0__1_System_Collections_Generic_IDictionary_System_Object_System_Object__" data-uid="CodeJam.Mapping.Mapper`2.Map(`0,`1,System.Collections.Generic.IDictionary{System.Object,System.Object})">Map(TFrom, TTo, IDictionary&lt;Object, Object&gt;)</h4>
  <div class="markdown level1 summary"><p>Returns a mapper to map an object of <em>TFrom</em> type to an object of <em>TTo</em> type.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TTo Map(TFrom source, TTo destination, IDictionary&lt;object, object&gt; crossReferenceDictionary)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TFrom</span></td>
        <td><span class="parametername">source</span></td>
        <td><p>Object to map.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">TTo</span></td>
        <td><span class="parametername">destination</span></td>
        <td><p>Destination object.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Collections.Generic.IDictionary</span>&lt;<span class="xref">System.Object</span>, <span class="xref">System.Object</span>&gt;</td>
        <td><span class="parametername">crossReferenceDictionary</span></td>
        <td><p>Storage for cress references if applied.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TTo</span></td>
        <td><p>Destination object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="extensionmethods">Extension Methods</h3>
  <div>
      <a class="xref" href="CodeJam.Mapping.Map.html#CodeJam_Mapping_Map_DeepCopy__1___0_">Map.DeepCopy&lt;T&gt;(T)</a>
  </div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Mapping_Mapper_2.md&amp;value=---%0Auid%3A%20CodeJam.Mapping.Mapper%602%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
                  </li>
                  <li>
                    <a href="https://github.com/rsdn/CodeJam/blob/master/Blocks/src/Mapping/Mapper.cs/#L19" class="contribution-link">View Source</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            Copyright � 2015-2017
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../../styles/docfx.js"></script>
    <script type="text/javascript" src="../../styles/main.js"></script>
  </body>
</html>
